home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5134 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: interramp.com!usenet
  2. From: tandemino@interramp.com (Joe Peterson)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What the heck is ...?
  5. Date: Mon, 12 Feb 1996 03:44:05 GMT
  6. Organization: Dolphin Systems, Inc.
  7. Message-ID: <311eb63e.1004560@usenet.interramp.com>
  8. References: <sconi-1102961642580001@ip-24.newportnet.net>
  9. NNTP-Posting-Host: ip38.birmingham.al.interramp.com
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. On Sun, 11 Feb 1996 16:42:57 -0800, sconi@superstore.com (Chris Tiee
  13. "Chochoni Boboni") mumbled:
  14.  
  15. >Here's something all the books love to avoid: The use of ... in function
  16. >declarations. For example, one book says that the prototype of printf() is
  17. >
  18. >int printf(const char *fmt_string, ...);
  19. >
  20. >but nowhere in the book does it ever document the meaning or usage of ...
  21. >. (actually, it did document ..., but because it was also a C++ book as
  22. >well, it said that ... is used to catch all the exceptions in exception
  23. >handling). I scrambled through some other C books, but they never made any
  24. >explanations at all.
  25. >
  26. >Doesn't anyone know what it does? I don't like to learn things without
  27. >learning it completely.
  28.  
  29. The elipsis indicates that the function has a variable number of
  30. arguments from that position on.  The compiler merely pushes the
  31. actual parameters onto the stack.  It is the responsibility of the
  32. called function to parse those values on the stack, using the
  33. 'varargs' constructs.  In fact, the called function could interpret
  34. the values in a way different from what the calling function expects
  35. them to be.
  36.  
  37. Pick up a copy of a good 'C' book for an explanation of how the called
  38. function might deal with a variable number of arguments.
  39. --
  40. Joe Peterson
  41. Dolphin Systems, Inc.
  42. West Palm Beach, Florida
  43.